const TokenKey = 'vue_admin_template_token'
const tokentime = 'token-timestamp-key'

export function getToken() {
  return JSON.parse(window.localStorage.getItem(TokenKey)) || ''
}

export function setToken(token) {
  return window.localStorage.setItem(TokenKey, JSON.stringify(token))
}

export function removeToken() {
  return window.localStorage.removeItem(TokenKey)
}

export function setTokentime() {
  return window.localStorage.setItem(tokentime, JSON.stringify(Date.now()))
}

export function getTokentime() {
  return JSON.parse(window.localStorage.getItem(tokentime))
}
